package org.sang.controller;

import org.sang.bean.Administrator;
import org.sang.bean.RespBean;
import org.sang.service.AdministratorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/*
 **@Author:刘淑钰
 **Created on 2021/12/17
 */
@RestController
public class LoginaController {
    @Autowired
    AdministratorService administratorService;

    @CrossOrigin
    @RequestMapping(value = "/loginaa", method = RequestMethod.POST)
    public RespBean adminLogin(@PathVariable String aname,@PathVariable String apwd) {
        int count = administratorService.getAdministratorByMassage(aname,apwd);
        if (count > 0) {
            return new RespBean("success", "管理员登录成功!");
        }
        return new RespBean("error", "管理员登录失败!");
    }

}
